<?php
/* 
	[BuyPg] (C) 2010-2011 Buypg
	$Id: BpAction.php 2011-3-31 17:12:13 wufujun $
 */

if (!defined('THINK_PATH')){
	exit('Access Denied');
}

class BaseAction extends Action{
	public $PublicPgsys;
	function _initialize(){
		/*global $_SGLOBAL;
		$_SGLOBAL = array();

		//时间
		$mtime = explode(' ', microtime());
		$_SGLOBAL['timestamp'] = $mtime[1];
		$_SGLOBAL['G_starttime'] = $_SGLOBAL['timestamp'] + $mtime[0];

		//GPC过滤
		$magic_quote = get_magic_quotes_gpc();
		if(empty($magic_quote)) {
			$_GET = saddslashes($_GET);
			$_POST = saddslashes($_POST);
		}

		//初始化
		$_SGLOBAL['G_uid'] = 0;
		$_SGLOBAL['G_username'] = '';
		$_SGLOBAL['inajax'] = empty($_GET['inajax'])?0:intval($_GET['inajax']);

		//处理REQUEST_URI
		if(!isset($_SERVER['REQUEST_URI'])) {
			$_SERVER['REQUEST_URI'] = $_SERVER['PHP_SELF'];
			if(isset($_SERVER['QUERY_STRING'])) $_SERVER['REQUEST_URI'] .= '?'.$_SERVER['QUERY_STRING'];
		}
		if($_SERVER['REQUEST_URI']) {
			$temp = urldecode($_SERVER['REQUEST_URI']);
			if(strexists($temp, '<') || strexists($temp, '"')) {
				$_GET = shtmlspecialchars($_GET);//XSS
			}
		}*/
		//初始化网站基本信息
		//include_once APP_PATH.'/Conf/buypg_config.php';
		//初始网站基本信息赋给全局
		/*$this->PublicPgsys = $pgsys;
		foreach ($pgsys['sysinfo'] as $key=>$value){
			$this->assign($key , $value);
		}
		$this->assign('sys_set' , $pgsys['sys_set']);
		$this->assign('sys_nav' , $pgsys['sys_nav']);
		$this->assign('sys_search_style' , $pgsys['sys_search_style']);
                */
		//判断用户登录状态
		//checkauth();
		//用户状态模板赋值
		//$this->assign('SGLOBAL', $_SGLOBAL);
		
	}

	
	
	//生成验证码
	 public function verify(){
		$type	 =	 isset($_GET['type'])?$_GET['type']:'gif';
        import("ORG.Util.Image");
        Image::buildImageVerify(4,1,$type);
    }
}

?>
